<?php
/**
 * Data model
 *
 * @category  DataModel
 * @package   DataModel
 * @author    DataModel Generator v1.3
 * @version   Revision: $Rev$
 */
/**
 * Data model for table "settings"
 *
 * @category  DataModel
 * @package   DataModel
 * @author    DataModel Generator v1.3
 * @version   Revision: $Rev$
 *
 * @property-read mixed Id
 * @property-read mixed ProjectId
 * @property-read mixed TestsPath
 * @property-read mixed LowCoverLevel
 * @property-read mixed MiddleCoverLevel
 * @property-read mixed HighCoverLevel
 * @property-read mixed RepositoryType
 * @property-read mixed RepositoryPath
 * @property-read mixed ResultPath
 * @property-read mixed HighlightedSourcePath
 * @property-read mixed Revision
 */
abstract class BaseSettings extends BaseRecord
{
    const TABLE_NAME = "settings";

    public function __construct()
    {
        parent::__construct(self::TABLE_NAME);
    }

    protected function initFields()
    {
        $this->hasColumn('id', 'PA:int(3)');
        $this->hasColumn('project_id', 'N:int(3)');
        $this->hasColumn('tests_path', 'N:varchar(255)');
        $this->hasColumn('low_cover_level', 'int(3)|30');
        $this->hasColumn('middle_cover_level', 'int(3)|50');
        $this->hasColumn('high_cover_level', 'int(3)|70');
        $this->hasColumn('repository_type', 'varchar(255)');
        $this->hasColumn('repository_path', 'varchar(255)');
        $this->hasColumn('result_path', 'N:varchar(255)');
        $this->hasColumn('highlighted_source_path', 'N:varchar(255)');
        $this->hasColumn('revision', 'UN:int(10)');
    }

    public function initRelations()
    {
        $this->addRelation('Project', new ORMRelationOne2One('Project', 'project_id', 'id'));
    }

    public function getById($id)
    {
        return parent::getById($id, 'Settings');
    }

    public function getByParams( $params, $type = ORMRecord::ONE_RECORD, $limit = null )
    {
        return parent::getByParams( $params, $type, $limit, 'Settings');
    }

    public function getAll( $limit = null )
    {
        return parent::getAll( $limit, 'Settings' );
    }
}